from enum import Enum


class FileType(Enum):
    IMAGE = ['bmp', 'gif', 'jpg', 'png', 'pbm', 'pgm', 'ppm', 'xbm', 'xpm','svg']

    def toFilterString(self):
        if isinstance(self.value, list):
            tp = ';'.join(['*.{}'.format(v) for v in self.value])
            return f'({tp})'
        else:
            return self.value


if __name__ == '__main__':
    print(FileType.IMAGE.toFilterString())
